feat(mcv): add --no-gpu support for cache creation without GPU hardware - #138
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe change adds unified and no-GPU image variants for MCV, the agent, and extraction components. It updates build workflows, deployment selection, GPU detection behavior, AMD parsing, tests, and usage documentation. ChangesContainer image variants
Estimated code review effort: 4 (Complex) | ~60 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Developer
participant BuildWorkflow
participant ContainerImage
participant Deployment
Developer->>BuildWorkflow: select unified or no-GPU variant
BuildWorkflow->>ContainerImage: build target and publish variant tags
Deployment->>ContainerImage: load selected image
Deployment->>Deployment: run GPU-aware or no-GPU operation
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
a8e5710 to
5df108d
Compare
5189125 to
5dd6939
Compare
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@mcv/docs/no-gpu-usage.md`:
- Around line 117-118: The examples use the unpublished image tag
"quay.io/gkm/mcv:full"; update those occurrences to the published AMD tag
"quay.io/gkm/mcv:amd" (replace "quay.io/gkm/mcv:full" with
"quay.io/gkm/mcv:amd") in the example commands so the extract/image flags (e.g.,
the lines showing "--extract --image quay.io/myorg/vllm-cache:v1 --dir /cache")
refer to the correct published AMD image; ensure all instances (including the
ones around the shown diff and the occurrences noted at lines ~117 and ~130) are
changed.
In `@mcv/images/amd64.dockerfile`:
- Around line 98-101: The Dockerfile is downloading the Ubuntu Jammy ROCm .deb
into the Debian Bookworm-based mcv-full stage which is brittle; replace the
Jammy-specific install with the Debian/Bookworm-compatible ROCm install flow:
remove the wget of the jammy URL and the local .deb install steps and instead
configure the official ROCm APT repository for Debian Bookworm (using
ROCM_VERSION/AMDGPU_VERSION variables as needed), apt-get update, and install
the ROCm packages (e.g., amd-smi-lib/rocm-smi-lib) from that repo; update the
RUN commands in mcv/images/amd64.dockerfile that reference the wget line and the
apt install ./*.deb sequence so the image uses the Debian repo-based installer
rather than the Ubuntu Jammy package.
- Around line 21-23: The Dockerfile currently downloads and extracts Go using
the RUN block that references GO_VERSION without verifying the tarball; update
the RUN step that uses wget/tar to also download the official SHA256 checksum
for the matching release, compute the SHA256 of /tmp/go.tgz (e.g., via
sha256sum), compare it to the expected checksum string
(957647d3d78995393c200542ab4c23c72b220c3848b6250787a2d48083818314 for go1.24.6),
and fail the build if mismatched before extracting: keep the same GO_VERSION
variable usage and ensure the verification occurs between the download (wget)
and the tar -xzf step in the RUN that currently removes /tmp/go.tgz.
In `@mcv/README.md`:
- Around line 533-536: The README has trailing whitespace in the updated
paragraph (around the line containing "quay.io/gkm/mcv:latest" /
"quay.io/gkm/mcv:amd" / "quay.io/gkm/mcv:nvidia"); run your project's pre-commit
hooks (or manually remove trailing spaces) to clean up trailing whitespace in
mcv/README.md, then commit the whitespace-only fix so the `trailing-whitespace`
pre-commit check passes.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 9e898107-7999-476e-a08b-6ac16a821111
📒 Files selected for processing (10)
.github/workflows/mcv-build-image.ymlmcv/Makefilemcv/README.mdmcv/cmd/main.gomcv/docs/no-gpu-usage.mdmcv/images/amd64.dockerfilemcv/images/entrypoint.shmcv/pkg/accelerator/devices/amd.gomcv/pkg/cache/dummytritonkey.gomcv/pkg/cache/vllm.go
|
Actionable comments posted: 0 |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
mcv/Makefile (1)
197-207:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPush the explicit
:unifiedtag too.
image-unifiedbuilds both:unifiedand:latest, butimage-pushonly publishes:latest. That leaves the documented:unifiedartifact stale or missing even though local builds create it.Suggested patch
$(CONTAINER_RUNTIME) push $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):minimal $(CONTAINER_RUNTIME) push $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):amd $(CONTAINER_RUNTIME) push $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):nvidia + $(CONTAINER_RUNTIME) push $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):unified $(CONTAINER_RUNTIME) push $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):latest🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mcv/Makefile` around lines 197 - 207, The image-push target currently pushes minimal, amd, nvidia and latest tags but omits the unified tag; update the image-push recipe (target: image-push) to also push $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):unified (e.g., add a $(CONTAINER_RUNTIME) push ...:unified line alongside the other tag pushes) so the :unified artifact produced by image-unified is published.mcv/images/amd64.dockerfile (1)
118-128:⚠️ Potential issue | 🟠 MajorAlign GPGME package with Ubuntu 24.04 (Noble) base in
mcv-nvidia.
mcv-nvidia(based onnvcr.io/nvidia/cuda:12.6.3-base-ubuntu24.04) installslibgpgme11, butmcv-unifiedon the same Ubuntu 24.04 base installslibgpgme11t64. Ubuntu 24.04 replaceslibgpgme11withlibgpgme11t64, somcv-nvidiais likely to fail duringapt-get install.Suggested patch
RUN apt-get update && apt-get install -y --no-install-recommends \ - libgpgme11 \ + libgpgme11t64 \ libbtrfs0 \ libffi8 \ libc6 \🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mcv/images/amd64.dockerfile` around lines 118 - 128, Replace the obsolete package name libgpgme11 with libgpgme11t64 in the apt-get install command in the Dockerfile RUN block (the line that currently installs libgpgme11 along with libbtrfs0, libffi8, libc6, etc.) so the image matches the Ubuntu 24.04 (Noble) package names used by mcv-unified and avoids apt install failures on the nvcr.io/nvidia/cuda:12.6.3-base-ubuntu24.04 base.
♻️ Duplicate comments (1)
mcv/images/amd64.dockerfile (1)
98-104:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftUse a ROCm-supported base for the ROCm-capable images.
mcv-amdadds a Jammy ROCm repo to Debian Bookworm, andmcv-unifiedadds the same Jammy repo to Ubuntu 24.04. In both stages,aptis resolving ROCm packages against a foreign distro, so these builds are brittle and can break on the next ROCm or base-image update. The ROCm variants should be built from a distro ROCm actually supports instead of layering Jammy packages onto Bookworm/Noble.Also applies to: 181-192
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mcv/images/amd64.dockerfile` around lines 98 - 104, The Dockerfile currently adds Jammy ROCm packages onto Debian Bookworm/Ubuntu 24.04 (see RUN wget ... amdgpu-install_${AMDGPU_VERSION} and subsequent apt installs), which is unsupported and brittle; update the mcv-amd and mcv-unified build stages to use an ROCm-supported base image (e.g., an Ubuntu Jammy or official ROCm base image matching ROCM_VERSION/OPT_ROCM_VERSION) instead of layering Jammy repos onto Bookworm/Noble, remove the cross-distro apt repo additions and foreign-package installs (the RUN wget/apt install ./*.deb and ln -s steps), and ensure ROCM_VERSION/AMDGPU_VERSION/OPT_ROCM_VERSION are aligned with the chosen base so apt update/apt install resolve natively; rebuild and verify amd-smi/rocm-smi binaries exist in /opt/rocm-${OPT_ROCM_VERSION}/bin in those stages.
🧹 Nitpick comments (1)
mcv/docs/unified-mcv-container.md (1)
20-28: ⚖️ Poor tradeoffAdd security guidance for privileged container usage.
The documentation extensively recommends
--privileged(lines 24, 65, 78, 93, 109) andprivileged: true(lines 140, 195) without explaining security implications or providing alternatives. Privileged containers bypass kernel security boundaries (AppArmor, SELinux, seccomp) and grant access to all host devices.Consider adding:
- A security notice early in the document explaining privileged implications
- Alternative approaches where applicable (e.g., specific
--deviceflags for GPU access may be sufficient in some scenarios)- A note that
--privilegedis required for certain operations (like buildah in cache creation) but may be reducible for read-only operationsExample addition after line 28:
> **Security Note:** The `--privileged` flag grants the container extensive host access. > This is required for cache creation (buildah) and certain GPU operations. > For production deployments, evaluate whether specific device access (`--device`) > or reduced capabilities meet your security requirements.Also applies to: 59-103, 115-204
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mcv/docs/unified-mcv-container.md` around lines 20 - 28, The document repeatedly recommends using --privileged and privileged: true without warnings; add a short security notice near the top of unified-mcv-container.md (after the Basic Usage block) that explains the security implications of --privileged, calls out that it bypasses AppArmor/SELinux/seccomp and grants host device access, and states that --privileged is only required for certain operations (e.g., buildah-based cache creation) while read-only or runtime GPU usage may be satisfied with targeted alternatives like --device flags or reduced capabilities; also annotate the other occurrences of --privileged / privileged: true in the file (the sections around lines 59-103 and 115-204) to recommend these alternatives and clarify when --privileged is necessary versus when device-level access suffices.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@mcv/docs/unified-mcv-container.md`:
- Around line 44-48: The fenced code block showing runtime detection logic lacks
a language specifier which prevents proper rendering; update the block around
the three lines referencing nvmlCheck(), rocmCheck(), and --no-gpu to include a
language identifier (for example use ```text) immediately after the opening
backticks so the block becomes ```text ... ``` to enable correct formatting and
highlighting.
- Around line 389-399: Update the documented snippet to reflect actual
registration order and logic: mention that registerDevices calls staticCheck(r)
first when config.IsStubEnabled() is true, then calls amdCheck(r), rocmCheck(r),
nvmlCheck(r) sequentially (no short-circuit “first wins”), and note AMD
detection relies on amd-smi via initAMDLib which uses utils.HasApp("amd-smi");
also state that AMD/ROCm exclusivity is handled in addDeviceInterface (AMD
unregisters ROCm and ROCm is skipped if AMD already registered).
---
Outside diff comments:
In `@mcv/images/amd64.dockerfile`:
- Around line 118-128: Replace the obsolete package name libgpgme11 with
libgpgme11t64 in the apt-get install command in the Dockerfile RUN block (the
line that currently installs libgpgme11 along with libbtrfs0, libffi8, libc6,
etc.) so the image matches the Ubuntu 24.04 (Noble) package names used by
mcv-unified and avoids apt install failures on the
nvcr.io/nvidia/cuda:12.6.3-base-ubuntu24.04 base.
In `@mcv/Makefile`:
- Around line 197-207: The image-push target currently pushes minimal, amd,
nvidia and latest tags but omits the unified tag; update the image-push recipe
(target: image-push) to also push
$(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):unified (e.g., add a
$(CONTAINER_RUNTIME) push ...:unified line alongside the other tag pushes) so
the :unified artifact produced by image-unified is published.
---
Duplicate comments:
In `@mcv/images/amd64.dockerfile`:
- Around line 98-104: The Dockerfile currently adds Jammy ROCm packages onto
Debian Bookworm/Ubuntu 24.04 (see RUN wget ... amdgpu-install_${AMDGPU_VERSION}
and subsequent apt installs), which is unsupported and brittle; update the
mcv-amd and mcv-unified build stages to use an ROCm-supported base image (e.g.,
an Ubuntu Jammy or official ROCm base image matching
ROCM_VERSION/OPT_ROCM_VERSION) instead of layering Jammy repos onto
Bookworm/Noble, remove the cross-distro apt repo additions and foreign-package
installs (the RUN wget/apt install ./*.deb and ln -s steps), and ensure
ROCM_VERSION/AMDGPU_VERSION/OPT_ROCM_VERSION are aligned with the chosen base so
apt update/apt install resolve natively; rebuild and verify amd-smi/rocm-smi
binaries exist in /opt/rocm-${OPT_ROCM_VERSION}/bin in those stages.
---
Nitpick comments:
In `@mcv/docs/unified-mcv-container.md`:
- Around line 20-28: The document repeatedly recommends using --privileged and
privileged: true without warnings; add a short security notice near the top of
unified-mcv-container.md (after the Basic Usage block) that explains the
security implications of --privileged, calls out that it bypasses
AppArmor/SELinux/seccomp and grants host device access, and states that
--privileged is only required for certain operations (e.g., buildah-based cache
creation) while read-only or runtime GPU usage may be satisfied with targeted
alternatives like --device flags or reduced capabilities; also annotate the
other occurrences of --privileged / privileged: true in the file (the sections
around lines 59-103 and 115-204) to recommend these alternatives and clarify
when --privileged is necessary versus when device-level access suffices.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: c3d769f1-4418-406d-974c-3d013a572bc2
📒 Files selected for processing (5)
.github/workflows/mcv-build-image.ymlmcv/Makefilemcv/README.mdmcv/docs/unified-mcv-container.mdmcv/images/amd64.dockerfile
✅ Files skipped from review due to trivial changes (1)
- mcv/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/mcv-build-image.yml
f6632ed to
2b9884b
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
mcv/Makefile (1)
198-207:⚠️ Potential issue | 🟠 Major | ⚡ Quick win
image-pushomits the:unifiedtag thatimage-unifiedcreates.Line 207 pushes
:latest, but there is no push for$(IMAGE_NAME):unified. That breaks the documented/public tag contract and can leave:unifiedmissing or stale in registry.Proposed fix
image-push: ## Push all container images to registry @@ $(CONTAINER_RUNTIME) push $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):minimal $(CONTAINER_RUNTIME) push $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):amd $(CONTAINER_RUNTIME) push $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):nvidia + $(CONTAINER_RUNTIME) push $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):unified $(CONTAINER_RUNTIME) push $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):latest🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mcv/Makefile` around lines 198 - 207, The image-push target is missing a push for the unified tag created by image-unified, so add a push for $(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):unified to image-push; update the image-push recipe (target image-push) to include a $(CONTAINER_RUNTIME) push invocation for the :unified tag alongside :minimal, :amd, :nvidia, and :latest so the :unified image in the registry stays current with the image-unified build.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@mcv/docs/unified-mcv-container.md`:
- Around line 44-48: Trailing spaces in the markdown lines containing
"nvmlCheck()", "rocmCheck()", and "--no-gpu" are causing the pre-commit
trailing-whitespace hook to fail; open the markdown, remove any trailing spaces
at the ends of those lines (and the additional trailing spaces reported around
lines 99–103), save, and recommit so the pre-commit hook and CI will pass.
---
Outside diff comments:
In `@mcv/Makefile`:
- Around line 198-207: The image-push target is missing a push for the unified
tag created by image-unified, so add a push for
$(IMAGE_REGISTRY)/$(IMAGE_REPOSITORY)/$(IMAGE_NAME):unified to image-push;
update the image-push recipe (target image-push) to include a
$(CONTAINER_RUNTIME) push invocation for the :unified tag alongside :minimal,
:amd, :nvidia, and :latest so the :unified image in the registry stays current
with the image-unified build.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Enterprise
Run ID: 779fa98c-d988-4924-a938-ef10a49c125e
📒 Files selected for processing (3)
mcv/Makefilemcv/docs/unified-mcv-container.mdmcv/images/amd64.dockerfile
🚧 Files skipped from review as they are similar to previous changes (1)
- mcv/images/amd64.dockerfile
b53a988 to
da8e2d9
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
mcv/docs/unified-mcv-container.md (1)
44-48: ⚡ Quick winAdd language specifier to the fenced code block.
The code block at line 44 is missing a language specifier, causing markdownlint warnings.
📝 Suggested fix
**Runtime Detection:** -``` +```text On NVIDIA node: nvmlCheck() → ✓ uses NVML On AMD node: rocmCheck() → ✓ uses rocm-smi On CPU node: both fail → ✓ uses --no-gpu mode</details> <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.In
@mcv/docs/unified-mcv-container.mdaround lines 44 - 48, The fenced code
block containing the lines "On NVIDIA node: nvmlCheck() → ✓ uses NVML", "On AMD
node: rocmCheck() → ✓ uses rocm-smi", and "On CPU node: both fail → ✓
uses --no-gpu mode" should include a language specifier to satisfy markdownlint;
update that block to use "text" (or another appropriate language) instead of just "" so the snippet is explicitly marked as plain text.</details> <!-- cr-comment:v1:d47fce6780822b7ff400d3ce --> _Source: Linters/SAST tools_ </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.Nitpick comments:
In@mcv/docs/unified-mcv-container.md:
- Around line 44-48: The fenced code block containing the lines "On NVIDIA node:
nvmlCheck() → ✓ uses NVML", "On AMD node: rocmCheck() → ✓ uses rocm-smi",
and "On CPU node: both fail → ✓ uses --no-gpu mode" should include a
language specifier to satisfy markdownlint; update that block to use "text" (or another appropriate language) instead of just "" so the snippet is
explicitly marked as plain text.</details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Organization UI **Review profile**: CHILL **Plan**: Enterprise **Run ID**: `db5a69e6-e85a-48a7-bf7c-eb3e991075c8` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between f6632ed1c95782a5d18d038dfa65a1a12cfe1cc0 and da8e2d9573f55bc8ab91d5d67b5a792a3c90d6f3. </details> <details> <summary>📒 Files selected for processing (4)</summary> * `mcv/Makefile` * `mcv/docs/unified-mcv-container.md` * `mcv/images/amd64.dockerfile` * `mcv/pkg/accelerator/devices/amd.go` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
da8e2d9 to
7ca7223
Compare
|
@Billy99 I will simplify this and clean it up and see if we want to merge then |
7ca7223 to
9667602
Compare
9667602 to
d878e41
Compare
- Move entrypoint.sh touch after successful /mcv run to fix init-file race where a killed process left a stale .initialized marker - Fix libgpgme11 -> libgpgme11t64 in mcv-nvidia target (Ubuntu 24.04 Noble) - Align :latest tag to no-gpu variant across CI, Makefiles, and docs; unified image now tagged :unified only - Standardise no-gpu tag to :no-gpu in root Makefile (was :latest-no-gpu) - Mark :amd/:nvidia mcv/Makefile targets as [dev-only]; remove from published images and image-push targets - Update ROCm version reference in unified-mcv-container.md (6.2.4 -> 7.0.1) - Add text language specifier to bare fenced code block (markdownlint MD040) - Add USER 65532:65532 to Containerfile.gkm-agent.no-gpu; document why unified agent/extract images require root (GPU device file access) - Add TestConfigureBoolFlagsNoGPU to guard the --no-gpu flag-ordering regression and TestDetectActualGPUInfo_NoGPUMode for the early-return path - Add build-image-gkm-extract backward-compat alias in root Makefile - Update PR description to match current branch (unified + no-gpu variants) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
- image-build.yml: replace deleted Containerfile.gkm-agent and Containerfile.gkm-extract with .unified variants; add no-gpu matrix entries for agent and extract with per-variant GHA cache scopes - image-build.yml: update job name to include variant suffix so unified and no-gpu jobs are distinct in the CI run view - mcv/Makefile: remove duplicate first image-amd and image-nvidia target blocks (dead code shadowed by the dev-only definitions added earlier) - Makefile: align AGENT_IMG_NO_GPU and GKM_EXTRACT_IMG_NO_GPU to :no-gpu tag (was :latest-no-gpu), consistent with the MCV naming convention - Makefile: document in push-images help that MCV :no-gpu/:latest are published via mcv/Makefile image-push or CI, not this target Note: Go version is not changed -- go.mod and amd64.dockerfile both pin 1.25.0; the reviewer's claim of a 1.25.7 mismatch was incorrect. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
Replace the separate AMD/NVIDIA/NoGPU MCV image variants and the deprecated gkm-extract image with a single unified container. The unified image (NVIDIA CUDA base + ROCm) auto-detects GPU vendor at runtime via NVML (NVIDIA) and amd-smi/rocm-smi (AMD). - mcv/images/amd64.dockerfile: add mcv-unified (CUDA+ROCm), mcv-nvidia (CUDA only), and --no-gpu support for CI/CD workflows - mcv/images/entrypoint.sh: add GKM env-var compatibility mode so mcv:unified is a drop-in replacement for gkm-extract (reads GKM_IMAGE_URL / GKM_CACHE_DIR / NO_GPU / GO_LOG) - .github/workflows/mcv-build-image.yml: build only the unified image; tagged as both :unified and :latest on main - Containerfile.gkm-agent: switch to CUDA base with always-on ROCm; remove NO_GPU build-arg variants - Makefile: remove NO_GPU_BUILD, rename build-image-gkm-extract to build-image-mcv, point EXTRACT_IMG at quay.io/gkm/mcv:latest - pkg/utils/contants.go: default extract image is now quay.io/gkm/mcv:latest - config/configMap: update gkm.extract.image to quay.io/gkm/mcv:latest Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… images Introduces GPU and no-GPU build targets for all three images so that arm64/mac environments can build and run without requiring CUDA or ROCm: - Containerfile.gkm-agent.no-gpu: debian:bookworm-slim runtime (no CUDA/ROCm) - Containerfile.gkm-extract: de-deprecated; this IS the no-GPU extract variant - Containerfile.gkm-extract.unified: NVIDIA CUDA + ROCm runtime for GPU envs - Makefile: adds AGENT_IMG_NO_GPU, MCV_IMG_NO_GPU, GKM_EXTRACT_IMG, GKM_EXTRACT_IMG_NO_GPU variables and corresponding build-image-* targets; adds build-images-no-gpu and push-images-no-gpu convenience targets. MCV already had mcv-minimal (no-GPU) and mcv-unified targets in mcv/images/amd64.dockerfile; build-image-mcv-no-gpu now wires up the mcv-minimal target in the Makefile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Makefile`:
- Around line 354-361: Update the Makefile’s deploy image selection so NO_GPU
takes precedence when both NO_GPU and KIND_CLUSTER are true, including the flow
around prepare-deploy. Update kind-load-images to load the same no-GPU image
variables selected for deployment, ensuring KIND uses the newly built no-GPU
images consistently.
In `@mcv/docs/unified-mcv-container.md`:
- Around line 119-140: Update mcv/docs/unified-mcv-container.md at lines 119-140
to add --no-gpu for CPU-node workflows, or explicitly restrict the Job to GPU
nodes. At lines 343-355, remove the automatic no-GPU fallback claim and state
that users must provide --no-gpu. At lines 419-425, qualify CPU-only support by
requiring explicit --no-gpu.
In `@mcv/images/entrypoint.sh`:
- Line 33: Update the entrypoint command around exec so non-MCV commands such as
bash -lc are passed through to their intended executable instead of being
forwarded to /mcv as arguments. Preserve the prior executable passthrough
behavior and ensure the Docker and Podman invocation examples continue working
without requiring entrypoint overrides.
In `@mcv/pkg/cache/vllm_test.go`:
- Around line 324-325: Update the test setup around config.SetEnabledGPU(false)
to capture the existing value from config.IsGPUEnabled() before changing it,
then have the t.Cleanup callback restore that captured value instead of
unconditionally enabling GPU.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f677664b-2f6e-4e5c-bd07-76e4595125ca
📒 Files selected for processing (21)
.github/workflows/image-build.yml.github/workflows/mcv-build-image.ymlContainerfile.gkm-agent.no-gpuContainerfile.gkm-agent.unifiedContainerfile.gkm-extractContainerfile.gkm-extract.no-gpuContainerfile.gkm-extract.unifiedMakefiledocs/Architecture.mddocs/GettingStartedGuide.mdmcv/Makefilemcv/README.mdmcv/cmd/main.gomcv/cmd/main_test.gomcv/docs/no-gpu-usage.mdmcv/docs/unified-mcv-container.mdmcv/images/amd64.dockerfilemcv/images/entrypoint.shmcv/pkg/accelerator/devices/amd.gomcv/pkg/cache/vllm.gomcv/pkg/cache/vllm_test.go
💤 Files with no reviewable changes (1)
- Containerfile.gkm-extract
🚧 Files skipped from review as they are similar to previous changes (4)
- mcv/pkg/cache/vllm.go
- mcv/cmd/main.go
- mcv/docs/no-gpu-usage.md
- mcv/pkg/accelerator/devices/amd.go
Restore entrypoint passthrough for non-flag commands (e.g. bash -lc), capture prior GPU state in vllm_test cleanup, and clarify --no-gpu requirements in unified-mcv-container docs. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Evaluate NO_GPU before KIND_CLUSTER in prepare-deploy, use DEPLOY_*_IMG for agent/extract consistently in kind-load-images, and pass NO_GPU to kind-load-images from deploy-on-kind so build-images-no-gpu + run-on-kind load and deploy the same no-gpu variants. Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@Containerfile.gkm-agent.unified`:
- Around line 74-76: Restore non-root execution for the unified GPU images by
updating the user configuration in Containerfile.gkm-agent.unified at lines
74-76 for /agent and Containerfile.gkm-extract.unified at lines 72-74 for
/gkm-extract. Grant GPU device-group access through deployment configuration or
another constrained mechanism so hardware detection continues without running
either application as root.
In `@mcv/docs/unified-mcv-container.md`:
- Around line 99-107: Update the “Compatibility Check” example in
unified-mcv-container.md to use the currently supported compatibility workflow
and remove the unsupported --check-compat flag, unless the CLI is explicitly
extended to implement it. Keep the documented command aligned with the options
exposed by the mcv CLI help, including the existing --create and --extract
commands.
- Around line 190-195: Update the command block to invoke the installed binary
at /mcv instead of relying on mcv being available on PATH, while preserving the
existing --extract arguments and cache directory.
- Around line 55-64: Update mcv/docs/unified-mcv-container.md:55-64 so the
--create example pushes or exports the generated OCI image before the --rm
container exits, or persists the Buildah store. At
mcv/docs/unified-mcv-container.md:18-23, mount a host volume at /cache so
extracted files survive container removal. At
mcv/docs/unified-mcv-container.md:257-264, show pushing from the creating
container or persisting and sharing its image store with the host.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b2c15240-bf1f-454b-b58d-62ac46e3ae2a
📒 Files selected for processing (21)
.github/workflows/image-build.yml.github/workflows/mcv-build-image.ymlContainerfile.gkm-agent.no-gpuContainerfile.gkm-agent.unifiedContainerfile.gkm-extractContainerfile.gkm-extract.no-gpuContainerfile.gkm-extract.unifiedMakefiledocs/Architecture.mddocs/GettingStartedGuide.mdmcv/Makefilemcv/README.mdmcv/cmd/main.gomcv/cmd/main_test.gomcv/docs/no-gpu-usage.mdmcv/docs/unified-mcv-container.mdmcv/images/amd64.dockerfilemcv/images/entrypoint.shmcv/pkg/accelerator/devices/amd.gomcv/pkg/cache/vllm.gomcv/pkg/cache/vllm_test.go
💤 Files with no reviewable changes (1)
- Containerfile.gkm-extract
🚧 Files skipped from review as they are similar to previous changes (4)
- mcv/cmd/main.go
- mcv/pkg/cache/vllm.go
- mcv/docs/no-gpu-usage.md
- mcv/pkg/accelerator/devices/amd.go
- Add multi-arch support to amd64.dockerfile: ARG TARGETARCH in all
stages, arch-aware Go download with per-arch SHA256 verification,
and copy mcv binary from linux_${TARGETARCH} output dir
- Update mcv/Makefile: replace hardcoded --platform linux/amd64 with
--platform linux/$(GOARCH) for all image targets
- Fix markdown rendering in no-gpu-usage.md and unified-mcv-container.md:
add '- ' prefix so property lists render as bullet lists
- Add comment in amd64.dockerfile clarifying that mcv-amd inherits
COPY and ENTRYPOINT from the mcv-minimal base stage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
…ntainer.md - Add volume mount to basic extract example so files survive --rm - Fix create example: chain buildah push inside the container so the OCI image reaches the registry before --rm removes the buildah store - Fix DaemonSet command: mcv -> /mcv (binary is not on PATH) - Fix CI/CD example: mount Docker socket and pass --builder docker so the subsequent docker push on the host can find the created image Skipped findings (with reasons): - gkm-agent/extract.unified non-root: root is intentional for GPU device file access, already documented; fixing requires cluster-level device group config, out of scope - --check-compat flag: fully implemented in mcv/cmd/main.go:96 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
ROCm only publishes amd64 packages; building on arm64 (e.g. Apple M-series via make docker-build) fails with unresolvable dependencies. - mcv-amd: fail fast with a clear error when TARGETARCH != amd64 - mcv-unified: wrap ROCm installation (and its apt deps) in an amd64 guard so the image still builds on arm64 with NVIDIA/NVML support only - Makefile: keep --platform linux/$(GOARCH) for all targets (arch logic now lives in the dockerfile where it belongs) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
…ainerfiles ROCm only publishes amd64 packages; building on arm64 (e.g. Apple M-series via make docker-build) fails with unresolvable dependencies. - Containerfile.gkm-agent.unified: add ARG TARGETARCH; wrap ROCm installation in an amd64 guard; move ROCm-only apt deps into the conditional block; add --no-install-recommends to base apt install - Containerfile.gkm-extract.unified: same treatment On arm64 both images still build and provide NVIDIA/NVML support via the CUDA base image; ROCm is skipped since it has no arm64 packages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
- README: callout block explaining mcv:latest resolves to the no-GPU variant and is not GPU-capable; directs GPU users to :unified - PR description: migration table (old tag behaviour → new), arm64 build-support note (build-verified, not yet CI-verified), and arm64 checklist item Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
Remove the GKM-specific env-var compatibility shim (GKM_IMAGE_URL, GKM_CACHE_DIR). The MCV entrypoint should delegate to whatever command the caller passes, not hard-wire operator-specific extraction logic. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/image-build.yml (1)
164-164: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftPublish arm64 manifests for the no-GPU variants.
Both workflows publish only
linux/amd64. The published no-GPU tags therefore cannot run on arm64 nodes, despite the stated arm64 support. Publishlinux/arm64for no-GPU variants. Keep unified variants amd64-only if ROCm prevents arm64 builds.
.github/workflows/image-build.yml#L164-L164: configure no-GPU agent and extraction builds to publishlinux/amd64,linux/arm64..github/workflows/mcv-build-image.yml#L113-L113: configure the no-GPU MCV build to publishlinux/amd64,linux/arm64.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/image-build.yml at line 164, Update the no-GPU agent and extraction build platform configuration in .github/workflows/image-build.yml at lines 164-164 to publish both linux/amd64 and linux/arm64, while keeping unified variants amd64-only. Update the no-GPU MCV build platform configuration in .github/workflows/mcv-build-image.yml at lines 113-113 similarly; no other variants require changes.Source: Path instructions
🧹 Nitpick comments (2)
mcv/cmd/main_test.go (1)
76-97: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftExercise create dispatch in this regression test.
The test calls
configureBoolFlagsdirectly. It still passes if--createdispatches before this function runs. Add a dispatch-level test for--create --no-gpu, with the create operation stubbed or injected, or narrow the comment to claim only unit coverage ofconfigureBoolFlags.As per path instructions, this review focuses on major issues impacting performance, readability, maintainability and security; this is a behavior-coverage gap, not a style nit.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mcv/cmd/main_test.go` around lines 76 - 97, The regression test TestConfigureBoolFlagsNoGPU only covers configureBoolFlags directly and does not verify --create dispatch ordering. Add a dispatch-level test exercising --create with --no-gpu, stubbing or injecting the create operation and asserting GPU detection is disabled; alternatively, narrow the test comment to describe only configureBoolFlags unit coverage.Source: Path instructions
mcv/docs/unified-mcv-container.md (1)
18-24: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winUse the least privilege required for extraction.
The extraction-only examples invoke
podman run --privileged, which grants all host capabilities and devices. The device-specific examples inmcv/docs/no-gpu-usage.mddo not use full privilege. Verify whether MCV extraction requires--privileged; if not, remove it and keep only the required GPU device flags. If it is required, document the exact requirement.As per path instructions, this review focuses on major issues impacting performance, readability, maintainability and security; this is a privilege-boundary issue, not a documentation nit.
Also applies to: 74-80, 89-95
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mcv/docs/unified-mcv-container.md` around lines 18 - 24, Update the extraction-only Podman examples to avoid --privileged unless MCV extraction demonstrably requires it; use only the necessary vendor-specific GPU device flags, matching the no-gpu-usage guidance. If full privilege is required, document the exact capability or device requirement and retain it only where necessary across all affected examples.Source: Path instructions
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/Architecture.md`:
- Around line 33-35: Update the “Kernel Cache Extraction and CSI Mounting
Behavior” section to match the documented current flow: the GKM Agent should
launch the gkm-extract/gkm-kernel-cache-extract Kubernetes Job rather than
directly downloading and extracting images. If the direct-extraction behavior is
still supported, explicitly label it as a separate legacy path.
In `@mcv/docs/no-gpu-usage.md`:
- Around line 44-46: Update the no-GPU usage examples around the `podman run`
commands, including the referenced command blocks, so the created OCI image is
persisted or pushed before `--rm` removes the container. Use an in-container
push, `--builder docker` with a trusted daemon, or a shared/persisted image
store, and ensure subsequent host-side push steps do not rely on the
container-internal Buildah store.
In `@mcv/docs/unified-mcv-container.md`:
- Around line 150-153: Update the Kubernetes Job manifest around the cache
volume to preserve extracted cache data beyond pod deletion by replacing
emptyDir with an appropriate PVC or hostPath, and document or configure the
consuming workload that reads it. If the cache is intentionally temporary,
explicitly state that lifecycle instead and remove any implication that the
output persists.
- Around line 313-325: Update the direct Docker command in the “Build the No-GPU
Image (arm64/mac)” section to target linux/arm64 instead of linux/amd64, while
preserving the existing make command and image target details.
---
Outside diff comments:
In @.github/workflows/image-build.yml:
- Line 164: Update the no-GPU agent and extraction build platform configuration
in .github/workflows/image-build.yml at lines 164-164 to publish both
linux/amd64 and linux/arm64, while keeping unified variants amd64-only. Update
the no-GPU MCV build platform configuration in
.github/workflows/mcv-build-image.yml at lines 113-113 similarly; no other
variants require changes.
---
Nitpick comments:
In `@mcv/cmd/main_test.go`:
- Around line 76-97: The regression test TestConfigureBoolFlagsNoGPU only covers
configureBoolFlags directly and does not verify --create dispatch ordering. Add
a dispatch-level test exercising --create with --no-gpu, stubbing or injecting
the create operation and asserting GPU detection is disabled; alternatively,
narrow the test comment to describe only configureBoolFlags unit coverage.
In `@mcv/docs/unified-mcv-container.md`:
- Around line 18-24: Update the extraction-only Podman examples to avoid
--privileged unless MCV extraction demonstrably requires it; use only the
necessary vendor-specific GPU device flags, matching the no-gpu-usage guidance.
If full privilege is required, document the exact capability or device
requirement and retain it only where necessary across all affected examples.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 02d7d5b2-7eda-4157-99e0-b4f22db56341
📒 Files selected for processing (23)
.github/workflows/image-build.yml.github/workflows/mcv-build-image.ymlContainerfile.gkm-agentContainerfile.gkm-agent.no-gpuContainerfile.gkm-agent.unifiedContainerfile.gkm-extractContainerfile.gkm-extract.no-gpuContainerfile.gkm-extract.unifiedMakefileREADME.mddocs/Architecture.mddocs/GettingStartedGuide.mdmcv/Makefilemcv/README.mdmcv/cmd/main.gomcv/cmd/main_test.gomcv/docs/no-gpu-usage.mdmcv/docs/unified-mcv-container.mdmcv/images/amd64.dockerfilemcv/images/entrypoint.shmcv/pkg/accelerator/devices/amd.gomcv/pkg/cache/vllm.gomcv/pkg/cache/vllm_test.go
💤 Files with no reviewable changes (3)
- Containerfile.gkm-agent
- mcv/images/entrypoint.sh
- Containerfile.gkm-extract
🚧 Files skipped from review as they are similar to previous changes (4)
- mcv/pkg/cache/vllm.go
- mcv/README.md
- mcv/pkg/accelerator/devices/amd.go
- mcv/cmd/main.go
- Rename mcv/images/amd64.dockerfile → mcv/images/Containerfile; the file has always supported both amd64 and arm64 via TARGETARCH — the old name was misleading. Update all references across Makefiles, docs, and CI. - CI (image-build.yml, mcv-build-image.yml): add per-variant platforms field; no-GPU variants now publish linux/amd64,linux/arm64 while GPU/unified variants remain linux/amd64-only (ROCm has no arm64 packages). - docs/Architecture.md: update GKM Agent bullet to say it launches the gkm-extract Kubernetes Job rather than directly extracting images. - mcv/docs/no-gpu-usage.md: fix --create container examples — replace --privileged with --device /dev/fuse and mount auth.json so buildah can push to the registry without full privilege. - mcv/docs/unified-mcv-container.md: replace --privileged with vendor- specific GPU device flags in Basic Usage; replace emptyDir with a PVC in the Kubernetes Job example; fix arm64/mac direct-build command to use --platform linux/arm64. - mcv/cmd/main_test.go: narrow TestConfigureBoolFlagsNoGPU comment to describe only the configureBoolFlags unit coverage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
- GettingStartedGuide.md: add `make build-images-no-gpu` before `make run-on-kind` in the quick-start; fix the private-build KIND section to use build-images-no-gpu + push-images-no-gpu; add a note explaining that agent/gkm-extract :latest = :unified (GPU) while MCV :latest = :no-gpu. - Makefile: fix DEPLOY_AGENT_IMG/DEPLOY_EXTRACT_IMG variable selection — KIND_CLUSTER=true now selects no-gpu variants even without NO_GPU=true, preventing a mismatch where prepare-deploy injected gkm.nogpu=true into the configMap but still deployed the unified (GPU) agent image. - gkm-extract/main.go: write the image URL into the .initialized init file instead of creating an empty sentinel; on startup compare the stored URL with the requested one and re-extract when they differ, so a cache image update is not silently skipped. Remove now-unused fileExists/createFile helpers and the "errors" import. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
- mcv/pkg/accelerator/devices/amd.go: replace LastIndexByte(']') truncation
with json.Decoder.Decode(), which reads exactly the first complete JSON value
and ignores trailing noise. The old approach dropped the closing '}' of the
{"gpu_data":[...]} wrapper format, producing invalid JSON and breaking AMD
GPU detection in unified images.
- gkm-extract/main.go: on image URL change, clear the cache directory before
re-extraction so stale files from the previous image do not mix with new
content; write the init file atomically via a .tmp file renamed to
.initialized only after successful extraction, so a crash mid-extract cannot
leave a stale sentinel that silently suppresses the next extraction attempt.
Add clearDirectory helper.
- config/agent/kustomization.yaml: remove spurious duplicate 'name: agent'
images entry that matched nothing (gkm-agent.yaml references the full
quay.io/gkm/agent image name); keep only the correct entry.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
mcv/images/Containerfile (2)
80-80: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winMake flag-only container invocations execute
/mcv.
mcv/images/entrypoint.shrunsexec "$@". The documentedpodman runanddocker runcommands pass flags such as--extractwithout/mcv, so the wrapper tries to execute--extractand exits. Update the entrypoint to prepend/mcvfor flag-only arguments, and defineCMD ["/mcv"]for runtime targets. ACMDalone does not fix flag-only invocations because supplied arguments replaceCMD.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mcv/images/Containerfile` at line 80, Update the image entrypoint configuration around ENTRYPOINT and entrypoint.sh so invocations whose arguments begin with flags prepend /mcv before execution, while preserving explicit command execution. Add CMD ["/mcv"] as the default runtime target, ensuring supplied flag arguments are handled by the wrapper rather than replacing the command.
114-125: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winPin the AMDGPU installer package before installation.
Both targets install a remotely downloaded
.debas root. The package adds APT sources and keyring files, but the directory provides no detached signature or checksum. Add a project-controlled SHA-256 pin or another pre-install authenticity check, and use a fixed package path instead of./*.deb.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mcv/images/Containerfile` around lines 114 - 125, Update the AMDGPU installation RUN step to verify the downloaded installer with a project-controlled SHA-256 pin or equivalent authenticity check before any installation occurs. Store it at a fixed package path and install that explicit path rather than using the broad ./*.deb glob, while preserving the existing cleanup behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@gkm-extract/main.go`:
- Around line 82-87: Update the extraction flow in main around clearDirectory
and os.WriteFile: return immediately when clearDirectory(cacheDir) fails instead
of logging and continuing, and likewise return the os.WriteFile error when
creating initFileTmp fails. Ensure extraction does not proceed or mark the cache
as initialized after either failure.
- Around line 73-74: Add a per-cache-directory lock around the complete
extraction transaction in LaunchJob, using a lock path derived from cacheDir and
acquiring it before the existing initialization check and file writes. Hold the
lock through extraction and initialization completion, then release it on every
exit path, ensuring concurrent controller instances cannot write the same
cacheDir.
---
Outside diff comments:
In `@mcv/images/Containerfile`:
- Line 80: Update the image entrypoint configuration around ENTRYPOINT and
entrypoint.sh so invocations whose arguments begin with flags prepend /mcv
before execution, while preserving explicit command execution. Add CMD ["/mcv"]
as the default runtime target, ensuring supplied flag arguments are handled by
the wrapper rather than replacing the command.
- Around line 114-125: Update the AMDGPU installation RUN step to verify the
downloaded installer with a project-controlled SHA-256 pin or equivalent
authenticity check before any installation occurs. Store it at a fixed package
path and install that explicit path rather than using the broad ./*.deb glob,
while preserving the existing cleanup behavior.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8c945d07-e8f6-497a-a43a-46c7e7e16631
📒 Files selected for processing (14)
.github/workflows/image-build.yml.github/workflows/mcv-build-image.ymlMakefileconfig/agent/kustomization.yamldocs/Architecture.mddocs/GettingStartedGuide.mdgkm-extract/main.gomcv/Makefilemcv/README.mdmcv/cmd/main_test.gomcv/docs/no-gpu-usage.mdmcv/docs/unified-mcv-container.mdmcv/images/Containerfilemcv/pkg/accelerator/devices/amd.go
💤 Files with no reviewable changes (1)
- config/agent/kustomization.yaml
🚧 Files skipped from review as they are similar to previous changes (10)
- docs/Architecture.md
- mcv/docs/no-gpu-usage.md
- mcv/cmd/main_test.go
- .github/workflows/image-build.yml
- mcv/docs/unified-mcv-container.md
- mcv/pkg/accelerator/devices/amd.go
- mcv/README.md
- mcv/Makefile
- .github/workflows/mcv-build-image.yml
- Makefile
…ndings gkm-extract/main.go: - Return immediately when clearDirectory fails (stale files would otherwise mix with new extraction) and when os.WriteFile for the init temp file fails (extraction must not proceed without a valid temp sentinel to promote). - Add a per-cacheDir exclusive flock (.extract.lock) acquired before the initialization check and held through extraction completion; released automatically on any return path when the file descriptor closes. Prevents concurrent controller instances from racing on the same cacheDir. mcv/images/entrypoint.sh: - Prepend /mcv when the first argument begins with a flag (e.g. --create, --extract) so callers can write `docker run image --create ...` without specifying the binary. Explicit commands pass through unchanged. mcv/images/Containerfile: - Add CMD ["/mcv"] to mcv-minimal, mcv-nvidia, and mcv-unified stages so the default invocation executes /mcv and supplied flag arguments are handled by the entrypoint wrapper rather than replacing the command. - Pin the AMDGPU installer download in both mcv-amd and mcv-unified stages with a project-controlled SHA-256 (f4cec246... for 7.0.1.70001-1_all.deb), write to an explicit /tmp path, and install that path instead of the broad ./*.deb glob. Update cleanup to remove /tmp/amdgpu-install.deb. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
- Add libdrm2 to ROCm install in Containerfile.gkm-extract.unified; amd-smi-lib depends on it at runtime - Release .extract.lock flock before the 300s back-off sleep so other Jobs on the same cacheDir are not blocked on a transient failure - Return error from os.Rename failure in ExtractCache instead of logging and returning nil - Switch getAMDListInfo to json.Decoder to tolerate trailing output from amd-smi list --json, matching getAMDGPUInfo behaviour - Preserve .extract.lock and .initialized.tmp in clearDirectory so the held flock inode is not replaced; prevents a concurrent Job acquiring a new lock and running extraction in parallel on URL change Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
- Move entrypoint.sh touch after successful /mcv run to fix init-file race where a killed process left a stale .initialized marker - Fix libgpgme11 -> libgpgme11t64 in mcv-nvidia target (Ubuntu 24.04 Noble) - Align :latest tag to no-gpu variant across CI, Makefiles, and docs; unified image now tagged :unified only - Standardise no-gpu tag to :no-gpu in root Makefile (was :latest-no-gpu) - Mark :amd/:nvidia mcv/Makefile targets as [dev-only]; remove from published images and image-push targets - Update ROCm version reference in unified-mcv-container.md (6.2.4 -> 7.0.1) - Add text language specifier to bare fenced code block (markdownlint MD040) - Add USER 65532:65532 to Containerfile.gkm-agent.no-gpu; document why unified agent/extract images require root (GPU device file access) - Add TestConfigureBoolFlagsNoGPU to guard the --no-gpu flag-ordering regression and TestDetectActualGPUInfo_NoGPUMode for the early-return path - Add build-image-gkm-extract backward-compat alias in root Makefile - Update PR description to match current branch (unified + no-gpu variants) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
- image-build.yml: replace deleted Containerfile.gkm-agent and Containerfile.gkm-extract with .unified variants; add no-gpu matrix entries for agent and extract with per-variant GHA cache scopes - image-build.yml: update job name to include variant suffix so unified and no-gpu jobs are distinct in the CI run view - mcv/Makefile: remove duplicate first image-amd and image-nvidia target blocks (dead code shadowed by the dev-only definitions added earlier) - Makefile: align AGENT_IMG_NO_GPU and GKM_EXTRACT_IMG_NO_GPU to :no-gpu tag (was :latest-no-gpu), consistent with the MCV naming convention - Makefile: document in push-images help that MCV :no-gpu/:latest are published via mcv/Makefile image-push or CI, not this target Note: Go version is not changed -- go.mod and amd64.dockerfile both pin 1.25.0; the reviewer's claim of a 1.25.7 mismatch was incorrect. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
- Fix GHA cache scope to include image+variant (prevents cross-workflow cache collisions) - Add t.Cleanup to restore global GPU state in TestConfigureBoolFlagsNoGPU - Correct CPU-node fallback doc: --no-gpu must be explicit, not automatic - Remove sleep 300 from entrypoint failure path; let Kubernetes restart backoff apply - Limit entrypoint chown to the cache directory itself (drop -R) to avoid traversing existing cache contents - NO_GPU=true deploy branch now uses AGENT_IMG_NO_GPU / GKM_EXTRACT_IMG_NO_GPU - Remove redundant OPT_ROCM_VERSION ARG from gkm-agent.unified and gkm-extract.unified; symlinks now use ROCM_VERSION - Document MCV :latest=:no-gpu policy difference vs agent/gkm-extract in no-gpu-usage.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
- Add multi-arch support to amd64.dockerfile: ARG TARGETARCH in all
stages, arch-aware Go download with per-arch SHA256 verification,
and copy mcv binary from linux_${TARGETARCH} output dir
- Update mcv/Makefile: replace hardcoded --platform linux/amd64 with
--platform linux/$(GOARCH) for all image targets
- Fix markdown rendering in no-gpu-usage.md and unified-mcv-container.md:
add '- ' prefix so property lists render as bullet lists
- Add comment in amd64.dockerfile clarifying that mcv-amd inherits
COPY and ENTRYPOINT from the mcv-minimal base stage
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
feat(mcv): Add `--no-gpu` support for cache creation without GPU hardware
Summary
This PR enables MCV to create and extract cache images without GPU hardware by using cache metadata instead of hardware detection. This is useful for CI/CD pipelines, development environments, and containerized workflows where GPU access isn't available.
Problem Statement
Previously, MCV required GPU hardware (NVIDIA or AMD) during cache image creation because it detected GPU information (architecture, backend, warp size) directly from the system. This made it impossible to:
Solution
Core Changes
`--no-gpu` Flag Support (main.go)
GPU Detection Bypass (vllm.go)
Two Published Image Variants (amd64.dockerfile)
CI/CD Integration (mcv-build-image.yml)
Simplified entrypoint (entrypoint.sh)
Documentation
Image Variants
Use Cases
Testing
```bash
Build and test locally
cd mcv && make build
Create cache image without GPU
./mcv --create --image docker.io/test/cache:v1
--dir example/qwen-binary-cache --no-gpu
```
Result: ✅ Successfully created cache image with GPU metadata extracted from cache files (backend: `cuda`, arch: `sm_75`, warp size: `32`)
Breaking Changes
Before this PR, pulling `quay.io/gkm/mcv` (with or without `:latest`) gave you a GPU-capable image. That is no longer the case for MCV. Agent and gkm-extract keep `:latest` on unified for backward compatibility.
Migration: any deployment that relied on `mcv:latest` for GPU validation or preflight checks must be updated to reference `mcv:unified` explicitly. Agent and gkm-extract deployments are unaffected.
All other changes are additive
arm64 Build Support
The `mcv:no-gpu`, `agent:no-gpu`, and `gkm-extract:no-gpu` images build natively on arm64 (Apple Silicon) via `make build-images-no-gpu` or `make docker-build NO_GPU=true`. The unified images build on arm64 too (ROCm is skipped since AMD has no arm64 packages; NVIDIA/NVML support is retained via the CUDA base).
Limitations
When using `--no-gpu`:
Recommendation: Use `--no-gpu` for building/distribution; validate with actual GPU hardware before production deployment.
Checklist